home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10147 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Invalid Indirection???
  5. Date: Fri, 15 Mar 96 16:07:55 GMT
  6. Organization: none
  7. Message-ID: <826906075snz@genesis.demon.co.uk>
  8. References: <4i7cck$t67@infa.central.susx.ac.uk> <4iah9k$r02@newshost.cyberramp.net>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4iah9k$r02@newshost.cyberramp.net>
  15.            sinan@cyberramp.net "John Noland" writes:
  16.  
  17. >In article <4i7cck$t67@infa.central.susx.ac.uk>, taux5@central.susx.ac.uk
  18. > says...
  19. >>
  20. >> tmp = (tempi[i]*tempj[i])+(tempi[i+1]*tempj[i+1]));
  21. >>        
  22. >>/* This is where the compiler stops and says there's an invalid
  23. >>indirection for the "tmp" assignment */
  24. >
  25. >To multiply, you need whitespace. Check the lexical conventions for the
  26. >evaluation of tokens for your compiler to be certain, but it looks like 
  27. >you've confused him.
  28.  
  29. No, the lexical analysis required is precisely defined by the language.
  30.  
  31. >Also, your open/closed parentheses don't match in this statement.
  32. >
  33. >Your statement should like this (underscores indicate spaces):
  34. >
  35. >tmp = ((tempi[i]_*_tempj[i]) + (tempi[i+1]_*_tempj[i+1]))
  36.  
  37. The white-space here makes no difference at all and woule elicit the same
  38. error from the compiler. You also need a ; at the end of the statement.
  39. As an observation none of the parentheses in that expression are required.
  40.  
  41. -- 
  42. -----------------------------------------
  43. Lawrence Kirby | fred@genesis.demon.co.uk
  44. Wilts, England | 70734.126@compuserve.com
  45. -----------------------------------------
  46.